package com.dg.redisson.locker;

import org.redisson.api.RLock;

import java.util.concurrent.TimeUnit;

/**
 * @Author dabing9
 * @Description
 * @Date 2019/5/23 0023 下午 14:36
 * @return
 **/
public interface DistributedLocker {

    RLock lock(String lockKey);

    RLock lock(String lockKey, long timeout);

    RLock lock(String lockKey, TimeUnit unit, long timeout);

    boolean tryLock(String lockKey, TimeUnit unit, long waitTime, long leaseTime);

    void unlock(String lockKey);

    void unlock(RLock lock);

}
